<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<link rel="stylesheet" href="css/mui.min.css">
		<!--<link href="css/mui.picker.css" rel="stylesheet" />
		<link href="css/mui.poppicker.css" rel="stylesheet" />-->
		<link rel="stylesheet" href="css/mui.picker.min.css">
	</head>
	<body>
		<!--<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">设置</h1>
		</header>-->
		<div class="mui-content">
			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell mui-media">
					<a class="mui-navigate-right" id="btnAbout">
						<img class="mui-media-object mui-pull-left" src="img/60_60.png">
						<div class="mui-media-body">
							实全科技
							<p class='mui-ellipsis'>实全-实用、安全</p>
						</div>
					</a>
				</li>
			</ul>
			<form class="mui-input-group" style="margin-top: 10px;">
				<div class="mui-input-row">
					<div class="mui-navigate-right" id="btnSelect">
						<label>搜索站点</label>
						<input type="text" id="txtSite" readonly="readonly" class="mui-input-clear mui-input" placeholder="搜索站点" />
					</div>
				</div>
				<div class="mui-input-row">
					<div class="mui-navigate-right" id="btnKeyword">
						<label>关键字</label>
						<input type="text" id="txtKeywod" readonly="readonly" class="mui-input-clear mui-input" placeholder="搜索关键字" />
					</div>
				</div>
			</form>
		</div>
	</body>
	<script src="js/mui.min.js "></script>
	<script src="js/mui.picker.min.js"></script>
	<script src="js/shiquan.site.js"></script>
	<script src="js/shiquan.app.js"></script>
	<script>
		mui.init({
			swipeBack:true //启用右滑关闭功能
		});
		
		mui.plusReady(function(){
			document.getElementById("txtSite").value = app.getSite();
			document.getElementById("txtKeywod").value = app.getKeyword();
			/*保存*/
			var btnAbout = document.getElementById('btnAbout');
			btnAbout.addEventListener('tap', function(event) {
				mui.openWindow("about.html","about");
			}, false);
			//普通示例
			var sitePicker = new mui.PopPicker();
			sitePicker.setData(siteData);
			/*保存*/
			var btnSelect = document.getElementById('btnSelect');
			btnSelect.addEventListener('tap', function(event) {
				sitePicker.show(function(items) {
					let site = items[0].value;
					document.getElementById("txtSite").value = site;
					app.setSite(site);
					mui.toast("数据保存成功！");
				});
			}, false);
			/*主页调用*/
			window.addEventListener('selectedkeyword', function(e) {
				console.log("detail="+JSON.stringify(e.detail));
		        document.getElementById("txtKeywod").value = e.detail.item;
		   	});
			/*保存*/
			var btnKeyword = document.getElementById('btnKeyword');
			btnKeyword.addEventListener('tap', function(event) {
				mui.openWindow("keyword.html","keyword");
			}, false);
		});
	</script>

</html>